package com.dongdongshop.config;

import java.io.FileWriter;
import java.io.IOException;


/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */
public class AlipayConfig {

    //↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2016093000634293";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCAbtl83gQCbbqf1O0Ivcqa64kXOZlIFy6Ya8GKxuCchIUb2o0fU0Tw5xtV0cCkGv1g5L8Er9EvDjUaldpszRKRYvm4IobTaTJ24iOi207/mp7Gt+vgUUbcCD1JV+LYURI69MgWvVe9QevAB8CMkRprBn15qdAP3/HHnuUvgZV7u15XxwBOsNp/ud4sABluxZFE/83c4d/60vC+6fsIM7LpAs8PnBv7jd3tFBHMlih7+bmExwFjXPZ71RCuHeAAahBJBu/S1AiiY7nScF4d0mdJ42llG8RUCzxaQBkY+83NXI6JgEBCo2mCPlBi0/X45H8sqvvX+qz/fB6Mm99UEnWzAgMBAAECggEAe5u0QGRhUYEQQ7Ina+lWLOIR8ENkTijZlKLpBErCdIFqptMiTYrT6FNVULRuhsLfKDkfyz/3wSUYYPzm2x5IB5tNojXAs4okopylFaGjF4hV1gW/xAYVf8GCUqt+TRlBxXI/fPtAjYr7fbc4T1F8LpNxgf24nP648ZnxFFbQauMbPeUMW7g3C4a7hoyPkdRd1JIh15fWY/XKuW58KxVorTZicxbq+G/+DNPEeGHCRy2rkkj/2ow/bwt/1clSvZSI2ytje+nsyhhAO7jbjF0EF1Lx+pTolDuoO8cKsEq1+Bwu6o/Sp1eNcR5myEhV4gdYzJeZhb8LVD0HjGZ9t0bSSQKBgQDOgbWmt9nuL9lbAJdelcQHJjIbBhXr5rTm+W+D6b1dxpkFreWuSFdWvZH6SN1GNDuqkqFUcSw5HVKfqJn621Jknf2ooJROih5xCoBpBcuCstfXZ2gHV2ntOTe3KBpKG0FYxGs9VPc0dlco3ysukWlgVho/k1E3EvlSjktm0j9PNwKBgQCfNub0yxer/te6rsqpKqRlCFSzO93jgw9hK3BvFaga2XugNnhb8zjniv/NuCi++3nxYf5Qahx4iYPvgSU6kFhy9zyRnVnsOBxUwhrLo0b7PGg0M4x+kGainSlk0jyFTb48+qQmwfGflF0l66dj43GUSbQyCn/B8gukwKaky9HzZQKBgG85SX9MEqLJPsZW4TBedcBsAByyAGiYT+L/geKIqCez6YM3kDd4WyIq5E7ro9JGG8TZSO9ULT9t3ayEgLquGgh7V73VD0vl9FNqFpN6PYxdiwdHeK5LlI/ie3G4tcAoQd/vmtrjwmmNO5CV8ooYY6sxdN29GMcS/xpJ7a6pmtOtAoGAQb8TOm0PdmgDP8TkTV0di9cX2vfS1huN40tj34tq4sOCaJN1ukrC6eKdZZ8xvEPuhD46HYzj+uaWg/WpoPhwffEYouz+cCxvjpSlKghfzGmSglPzJWSN7YLG0Cp88XM8JsQ9uv+Fvqcum/UnJ3mJsnmJHsz1GurP4hXn+s9sAH0CgYEAo8s6MpSWHoeGp/W87yCJLx/Ohr9W30bdQ+nU++/xBi4MqsTYKk781x6Sv90CYNkQs20Fg5KsZo1BrKSkHIRpGDRiTRagJ5XK4345gySK5YgKWjiw8rwLiAezqIicFVg1aD0IkkyEKxF1/gQo77xiVTSedDqJwk8JesPl7e86wv0=";
    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAibiZ98GRRmgJP/kGs7qf6dx4KgExm55UOqV7FHtCef0eRLVTYFy9rtAzOkFfOU1o8I8yrxEkQx3/Va8MVs2zD9POIBm8wnpk0yKPrllzwJjNH+uSOHRwwkm3fF+azglft3CBiI6pY5lJJYO3HIShnI+uIuCr7xcxkrGTPDnsdLiF60ikdV59+ZZdDDnpL5Wq/IvaCb2DaK90xvnOi3piCmysmKlu/b6ICVM4itz3YW7Ib0nlOXzcEoRVSNE9WsrAK26e4QYGw8KMOTQa2/cy84Ou27WkhkzH/ft4fKKWwKEYGI1KRgh05vK3WgLYuAjnPQz+HEz//ysWMM1Sjlw3hwIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "https://62a204t944.zicp.fun/notifyUrl";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "https://62a204t944.zicp.fun/returnUrl";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
